language: php

sudo: false

cache:
    directories:
        - vendor
        - $HOME/.composer/cache/files

php:
    - 7.2
    - 7.3
    - 7.4
    - nightly

matrix:
    include:
        - php: 7.2
          env: deps=low
    fast_finish: true

env:
    global:
        - SYMFONY_PHPUNIT_DISABLE_RESULT_CACHE=1
        - deps=no

before_install:
    - phpenv config-rm xdebug.ini || return 0
    - echo memory_limit = -1 >> ~/.phpenv/versions/$TRAVIS_PHP_VERSION/etc/conf.d/travis.ini

install:
    - if [ $TRAVIS_PHP_VERSION = "nightly" ]; then composer config platform.php 7.4.99; fi;
    - if [ "$deps" = "no" ]; then composer install; fi;
    - if [ "$deps" = "low" ]; then composer --prefer-lowest --prefer-stable update; fi;
    - if [ $TRAVIS_PHP_VERSION = "nightly" ]; then composer config --unset platform.php; fi;
    - ./vendor/bin/simple-phpunit install

script:
    - ./vendor/bin/simple-phpunit
